from selenium.webdriver.common.by import By
from time import sleep
from pages.LoginPage import LoginPage
from selenium import webdriver

class Recruitment(LoginPage):
    rec_report = (By.XPATH,'//*[contains(text(),"招聘报表")]')
    person_report = (By.LINK_TEXT,'人事报表')
    follow_report = (By.LINK_TEXT,'跟进统计')
    priority_report = (By.LINK_TEXT,'优先级统计')
    select = (By.XPATH,'//*[contains(text(),"查 询")]/..')

    click_time = ('class name','ant-calendar-picker-input')
    send_begin_time = (By.CLASS_NAME,'ant-calendar-input')
    send_end_time = (By.CLASS_NAME, 'ant-calendar-input')
    def __init__(self,browser):
        super().__init__(browser)
        self.login()
        self.find_ele(self.loc_statistics).click()
        self.find_ele(self.rec_report).click()

    def person(self):
        self.find_ele(self.person_report).click()
        self.find_ele(self.select).click()
        # self.find_ele(self.click_time)[0].click()
        self.find_ele(self.begin_time).click()
        self.find_ele(self.send_begin_time).send_keys('2023-08-08')
        sleep(1)

        # self.find_ele(self.click_time)[1].click()
        self.find_ele(self.send_end_time).send_keys('2023-08-15')
    def follow(self):
        self.find_ele(self.follow_report).click()
    def priority(self):
        self.find_ele(self.priority_report).click()

if __name__ == '__main__':
    a = Recruitment(webdriver.Chrome())
    a.person()
    # a.follow()
    # a.priority()
    b = input()
